/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * JDialogMedic.java
 *
 * Created on 06/05/2010, 18:46:29
 */
package systole.view.crud.medic;

import javax.swing.JComboBox;
import javax.swing.JTextField;
import org.jdesktop.application.Action;

/**
 *
 * @author jmj
 */
public class JDialogMedic extends javax.swing.JDialog {

    /**
     *
     */
    private static final long serialVersionUID = 1109766886475432155L;
    private ControllerMedicEdition controllerMedicEdition;

    /** Creates new form JDialogMedic
     * @param parent
     * @param controllerMedicEdition
     * */
    public JDialogMedic(java.awt.Frame parent, ControllerMedicEdition controllerMedicEdition) {
        super(parent, true);
        initComponents();
        this.controllerMedicEdition = controllerMedicEdition;
        this.initForm();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPnlData = new javax.swing.JPanel();
        jLblSex = new javax.swing.JLabel();
        jEdtIdentityNumber = new javax.swing.JTextField();
        jLblIdentityType = new javax.swing.JLabel();
        jLblBirthdate = new javax.swing.JLabel();
        jCbmIdentityType = new javax.swing.JComboBox();
        jEdtName = new javax.swing.JTextField();
        jLblNumber = new javax.swing.JLabel();
        jCbmSex = new javax.swing.JComboBox();
        jEdtSurname = new javax.swing.JTextField();
        jLblName = new javax.swing.JLabel();
        jLblSurname = new javax.swing.JLabel();
        jXDatePickerBirthdate = new org.jdesktop.swingx.JXDatePicker();
        jEdtCellphone = new javax.swing.JTextField();
        jLblCellphone = new javax.swing.JLabel();
        jLblMail = new javax.swing.JLabel();
        jLblTelephone = new javax.swing.JLabel();
        jEdtAddress = new javax.swing.JTextField();
        jEdtTelephone = new javax.swing.JTextField();
        jEdtMail = new javax.swing.JTextField();
        jLblAddress = new javax.swing.JLabel();
        jLblSpeciality = new javax.swing.JLabel();
        jLblLicense = new javax.swing.JLabel();
        jTxtLicense = new javax.swing.JTextField();
        jTxtSpeciality = new javax.swing.JTextField();
        jPnlBtns = new javax.swing.JPanel();
        jBtnOk = new javax.swing.JButton();
        jBtnCancel = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setModal(true);
        setName("Form"); // NOI18N
        setResizable(false);

        jPnlData.setName("jPnlData"); // NOI18N

        org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(systole.view.SystoleApp.class).getContext().getResourceMap(JDialogMedic.class);
        jLblSex.setText(resourceMap.getString("jLblSex.text")); // NOI18N
        jLblSex.setName("jLblSex"); // NOI18N

        jEdtIdentityNumber.setText(resourceMap.getString("jEdtIdentityNumber.text")); // NOI18N
        jEdtIdentityNumber.setToolTipText(resourceMap.getString("jEdtIdentityNumber.toolTipText")); // NOI18N
        jEdtIdentityNumber.setName("jEdtIdentityNumber"); // NOI18N

        jLblIdentityType.setText(resourceMap.getString("jLblIdentityType.text")); // NOI18N
        jLblIdentityType.setName("jLblIdentityType"); // NOI18N

        jLblBirthdate.setText(resourceMap.getString("jLblBirthdate.text")); // NOI18N
        jLblBirthdate.setName("jLblBirthdate"); // NOI18N

        jCbmIdentityType.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
        jCbmIdentityType.setToolTipText(resourceMap.getString("jCbmIdentityType.toolTipText")); // NOI18N
        jCbmIdentityType.setName("jCbmIdentityType"); // NOI18N

        jEdtName.setText(resourceMap.getString("jEdtName.text")); // NOI18N
        jEdtName.setToolTipText(resourceMap.getString("jEdtName.toolTipText")); // NOI18N
        jEdtName.setName("jEdtName"); // NOI18N

        jLblNumber.setText(resourceMap.getString("jLblNumber.text")); // NOI18N
        jLblNumber.setName("jLblNumber"); // NOI18N

        jCbmSex.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "F", "M" }));
        jCbmSex.setToolTipText(resourceMap.getString("jCbmSex.toolTipText")); // NOI18N
        jCbmSex.setName("jCbmSex"); // NOI18N

        jEdtSurname.setText(resourceMap.getString("jEdtSurname.text")); // NOI18N
        jEdtSurname.setToolTipText(resourceMap.getString("jEdtSurname.toolTipText")); // NOI18N
        jEdtSurname.setName("jEdtSurname"); // NOI18N

        jLblName.setFont(jLblName.getFont().deriveFont(jLblName.getFont().getStyle() | java.awt.Font.BOLD));
        jLblName.setText(resourceMap.getString("jLblName.text")); // NOI18N
        jLblName.setName("jLblName"); // NOI18N

        jLblSurname.setFont(jLblSurname.getFont().deriveFont(jLblSurname.getFont().getStyle() | java.awt.Font.BOLD));
        jLblSurname.setText(resourceMap.getString("jLblSurname.text")); // NOI18N
        jLblSurname.setName("jLblSurname"); // NOI18N

        jXDatePickerBirthdate.setToolTipText(resourceMap.getString("jXDatePickerBirthdate.toolTipText")); // NOI18N
        jXDatePickerBirthdate.setName("jXDatePickerBirthdate"); // NOI18N

        jEdtCellphone.setText(resourceMap.getString("jEdtCellphone.text")); // NOI18N
        jEdtCellphone.setToolTipText(resourceMap.getString("jEdtCellphone.toolTipText")); // NOI18N
        jEdtCellphone.setName("jEdtCellphone"); // NOI18N

        jLblCellphone.setText(resourceMap.getString("jLblCellphone.text")); // NOI18N
        jLblCellphone.setName("jLblCellphone"); // NOI18N

        jLblMail.setText(resourceMap.getString("jLblMail.text")); // NOI18N
        jLblMail.setName("jLblMail"); // NOI18N

        jLblTelephone.setText(resourceMap.getString("jLblTelephone.text")); // NOI18N
        jLblTelephone.setName("jLblTelephone"); // NOI18N

        jEdtAddress.setText(resourceMap.getString("jEdtAddress.text")); // NOI18N
        jEdtAddress.setToolTipText(resourceMap.getString("jEdtAddress.toolTipText")); // NOI18N
        jEdtAddress.setName("jEdtAddress"); // NOI18N

        jEdtTelephone.setText(resourceMap.getString("jEdtTelephone.text")); // NOI18N
        jEdtTelephone.setToolTipText(resourceMap.getString("jEdtTelephone.toolTipText")); // NOI18N
        jEdtTelephone.setName("jEdtTelephone"); // NOI18N

        jEdtMail.setText(resourceMap.getString("jEdtMail.text")); // NOI18N
        jEdtMail.setToolTipText(resourceMap.getString("jEdtMail.toolTipText")); // NOI18N
        jEdtMail.setName("jEdtMail"); // NOI18N

        jLblAddress.setText(resourceMap.getString("jLblAddress.text")); // NOI18N
        jLblAddress.setName("jLblAddress"); // NOI18N

        jLblSpeciality.setText(resourceMap.getString("jLblSpeciality.text")); // NOI18N
        jLblSpeciality.setName("jLblSpeciality"); // NOI18N

        jLblLicense.setText(resourceMap.getString("jLblLicense.text")); // NOI18N
        jLblLicense.setName("jLblLicense"); // NOI18N

        jTxtLicense.setText(resourceMap.getString("jTxtLicense.text")); // NOI18N
        jTxtLicense.setToolTipText(resourceMap.getString("jTxtLicense.toolTipText")); // NOI18N
        jTxtLicense.setName("jTxtLicense"); // NOI18N

        jTxtSpeciality.setText(resourceMap.getString("jTxtSpeciality.text")); // NOI18N
        jTxtSpeciality.setToolTipText(resourceMap.getString("jTxtSpeciality.toolTipText")); // NOI18N
        jTxtSpeciality.setName("jTxtSpeciality"); // NOI18N

        javax.swing.GroupLayout jPnlDataLayout = new javax.swing.GroupLayout(jPnlData);
        jPnlData.setLayout(jPnlDataLayout);
        jPnlDataLayout.setHorizontalGroup(
            jPnlDataLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPnlDataLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPnlDataLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLblSurname, javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLblIdentityType, javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLblSex, javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLblLicense, javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLblTelephone, javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLblMail, javax.swing.GroupLayout.Alignment.TRAILING))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPnlDataLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jTxtLicense, javax.swing.GroupLayout.DEFAULT_SIZE, 172, Short.MAX_VALUE)
                    .addComponent(jEdtTelephone, javax.swing.GroupLayout.DEFAULT_SIZE, 172, Short.MAX_VALUE)
                    .addComponent(jEdtMail, javax.swing.GroupLayout.DEFAULT_SIZE, 172, Short.MAX_VALUE)
                    .addComponent(jEdtSurname, javax.swing.GroupLayout.DEFAULT_SIZE, 200, Short.MAX_VALUE)
                    .addGroup(jPnlDataLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                        .addComponent(jCbmIdentityType, javax.swing.GroupLayout.Alignment.LEADING, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(jCbmSex, javax.swing.GroupLayout.Alignment.LEADING, 0, 100, Short.MAX_VALUE)))
                .addGap(18, 18, 18)
                .addGroup(jPnlDataLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLblName)
                    .addComponent(jLblBirthdate)
                    .addComponent(jLblSpeciality)
                    .addComponent(jLblCellphone)
                    .addComponent(jLblAddress)
                    .addComponent(jLblNumber))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPnlDataLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jTxtSpeciality)
                    .addComponent(jEdtIdentityNumber)
                    .addComponent(jXDatePickerBirthdate, javax.swing.GroupLayout.PREFERRED_SIZE, 154, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jEdtAddress)
                    .addComponent(jEdtCellphone, javax.swing.GroupLayout.DEFAULT_SIZE, 185, Short.MAX_VALUE)
                    .addComponent(jEdtName))
                .addContainerGap(61, Short.MAX_VALUE))
        );

        jPnlDataLayout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {jEdtMail, jEdtTelephone, jTxtLicense});

        jPnlDataLayout.setVerticalGroup(
            jPnlDataLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPnlDataLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPnlDataLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
                    .addComponent(jLblSurname)
                    .addComponent(jEdtSurname, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLblName)
                    .addComponent(jEdtName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPnlDataLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
                    .addComponent(jLblIdentityType)
                    .addComponent(jCbmIdentityType, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLblNumber)
                    .addComponent(jEdtIdentityNumber, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPnlDataLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
                    .addComponent(jLblSex)
                    .addComponent(jCbmSex, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLblBirthdate)
                    .addComponent(jXDatePickerBirthdate, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPnlDataLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
                    .addComponent(jLblLicense)
                    .addComponent(jTxtLicense, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLblSpeciality)
                    .addComponent(jTxtSpeciality, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPnlDataLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
                    .addComponent(jLblTelephone)
                    .addComponent(jEdtTelephone, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLblCellphone)
                    .addComponent(jEdtCellphone, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPnlDataLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
                    .addComponent(jLblMail)
                    .addComponent(jEdtMail, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLblAddress)
                    .addComponent(jEdtAddress, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(36, Short.MAX_VALUE))
        );

        jPnlDataLayout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {jEdtAddress, jEdtCellphone, jEdtIdentityNumber, jEdtMail, jEdtName, jEdtSurname, jEdtTelephone, jTxtLicense});

        jPnlDataLayout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {jCbmIdentityType, jCbmSex});

        getContentPane().add(jPnlData, java.awt.BorderLayout.CENTER);

        jPnlBtns.setName("jPnlBtns"); // NOI18N
        jPnlBtns.setPreferredSize(new java.awt.Dimension(600, 40));

        javax.swing.ActionMap actionMap = org.jdesktop.application.Application.getInstance(systole.view.SystoleApp.class).getContext().getActionMap(JDialogMedic.class, this);
        jBtnOk.setAction(actionMap.get("confirm")); // NOI18N
        jBtnOk.setText(resourceMap.getString("jBtnOk.text")); // NOI18N
        jBtnOk.setName(""); // NOI18N
        jPnlBtns.add(jBtnOk);

        jBtnCancel.setAction(actionMap.get("cancel")); // NOI18N
        jBtnCancel.setText(resourceMap.getString("jBtnCancel.text")); // NOI18N
        jBtnCancel.setName(""); // NOI18N
        jPnlBtns.add(jBtnCancel);

        getContentPane().add(jPnlBtns, java.awt.BorderLayout.PAGE_END);

        pack();
    }// </editor-fold>//GEN-END:initComponents
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jBtnCancel;
    private javax.swing.JButton jBtnOk;
    private javax.swing.JComboBox jCbmIdentityType;
    private javax.swing.JComboBox jCbmSex;
    private javax.swing.JTextField jEdtAddress;
    private javax.swing.JTextField jEdtCellphone;
    private javax.swing.JTextField jEdtIdentityNumber;
    private javax.swing.JTextField jEdtMail;
    private javax.swing.JTextField jEdtName;
    private javax.swing.JTextField jEdtSurname;
    private javax.swing.JTextField jEdtTelephone;
    private javax.swing.JLabel jLblAddress;
    private javax.swing.JLabel jLblBirthdate;
    private javax.swing.JLabel jLblCellphone;
    private javax.swing.JLabel jLblIdentityType;
    private javax.swing.JLabel jLblLicense;
    private javax.swing.JLabel jLblMail;
    private javax.swing.JLabel jLblName;
    private javax.swing.JLabel jLblNumber;
    private javax.swing.JLabel jLblSex;
    private javax.swing.JLabel jLblSpeciality;
    private javax.swing.JLabel jLblSurname;
    private javax.swing.JLabel jLblTelephone;
    private javax.swing.JPanel jPnlBtns;
    private javax.swing.JPanel jPnlData;
    private javax.swing.JTextField jTxtLicense;
    private javax.swing.JTextField jTxtSpeciality;
    private org.jdesktop.swingx.JXDatePicker jXDatePickerBirthdate;
    // End of variables declaration//GEN-END:variables

    /**
     * @return Identity card type combobox
     */
    public JComboBox getjCbmIdentityType() {
        return jCbmIdentityType;
    }

    /**
     * @return sex combobox
     */
    public JComboBox getjCbmSex() {
        return jCbmSex;
    }

    /**
     * @return address edit
     */
    public JTextField getjEdtAddress() {
        return jEdtAddress;
    }

    /**
     * @return cell phone edit
     */
    public JTextField getjEdtCellphone() {
        return jEdtCellphone;
    }

    /**
     * @return Identity number edit
     */
    public JTextField getjEdtIdentityNumber() {
        return jEdtIdentityNumber;
    }

    /**
     * @return Mail edit
     */
    public JTextField getjEdtMail() {
        return jEdtMail;
    }

    /**
     * @return name edit
     */
    public JTextField getjEdtName() {
        return jEdtName;
    }

    /**
     * @return surname edit
     */
    public JTextField getjEdtSurname() {
        return jEdtSurname;
    }

    /**
     * @return Telephone edit
     */
    public JTextField getjEdtTelephone() {
        return jEdtTelephone;
    }

    private void initForm() {
        this.jCbmSex.removeAllItems();
        this.jCbmSex.addItem("F");
        this.jCbmSex.addItem("M");
    }

    /**
     * confirm changes
     */
    @Action
    public void confirm() {
        this.controllerMedicEdition.ok();
    }

    /**
     * cancel changes
     */
    @Action
    public void cancel() {
        this.controllerMedicEdition.cancel();
    }

    /**
     * @return the jXDatePickerBirthdate
     */
    public org.jdesktop.swingx.JXDatePicker getjXDatePickerBirthdate() {
        return jXDatePickerBirthdate;
    }

    /**
     * @return the jTxtLicense
     */
    public javax.swing.JTextField getjTxtLicense() {
        return jTxtLicense;
    }

    /**
     * @return the jTxtSpeciality
     */
    public javax.swing.JTextField getjTxtSpeciality() {
        return jTxtSpeciality;
    }

      
}



